﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Optimization;
using StructureMap;

namespace EasyGo.Web
{
   
    public class MvcApplication : HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            Config.Routes.Init(GlobalConfiguration.Configuration, RouteTable.Routes);
            Config.Ioc.Init();
            Config.Mapping.Init();
            Config.Bundles.Init(BundleTable.Bundles);
        }

        protected void Application_EndRequest()
        {
            ObjectFactory.ReleaseAndDisposeAllHttpScopedObjects();
        }
    }
}